<template lang="pug">
  div.course-card-record
    div.title {{record.cname}}
    div.content
        div.item
            span {{record.tname}}
            span.times
                span {{record.state==0?'-':'+'}}{{record.num}}
    div.time {{record.createtime|timeFilter}}
        
</template>
<script>
import moment from 'moment'

export default {
    props:['record'],
    filters:{
        timeFilter(time){
            return moment(time, 'X').format('YYYY-MM-DD HH:mm:ss')
        }
    }
}
</script>

<style lang="stylus" scoped>
.course-card-record{
    display: block;
    background-color: #fff;
    font-size: .3rem;
    line-height: .5rem;
    >.title{
        padding: .2rem .3rem .1rem .3rem;
        font-weight: bold;
        border-bottom: solid 1px #eee;
        .price{
            font-size: .25rem;
            margin-left: .3rem;
            color: #666;
            font-weight: normal;
        }
    }
    .content{
        .item{
            padding: .1rem .3rem .1rem .1rem;
            margin-left: 1rem;
            border-bottom: solid 1px #eee;
            display: flex;
            justify-content: space-between;
            .times{
                span{
                    color: #ac0e0e;
                }
            }
        }
    }
    .time{
        padding: .1rem .3rem .2rem .3rem;
        color: #666;
    }
}
</style>
